<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags"%>
<%@ taglib prefix="c" uri="/WEB-INF/tlds/hdiv-c.tld"%>
<script>
    $(document).ready(function(){
        $("#noClavDiarDiv").dialog({
            modal: true,
            buttons:{
                    Cancelar:function() {
                                    $( this ).dialog( "close" );
                                    window.location = '<c:url value="home.html"/>';
                                },
                    Aceptar: function() {
                                    $( this ).dialog( "close" );
                                    window.location = '<c:url value="mostrarHWF2002.html"/>';
                                }
                    },
            width: 450
        });
    });
</script>

<div id="noClavDiarDiv">
    <p>No se encuentra registrada una clave diaria para el dia de hoy</p>
    <sec:authorize ifAllGranted="ROLE_HWF2002">
        <p>&iquest;Desea Registrarla ahora?</p>        
    </sec:authorize>
    
    <sec:authorize ifNotGranted="ROLE_HWF2002">
        <script>
            $('#noClavDiarDiv').dialog('removebutton', 'Aceptar');
            $('#noClavDiarDiv').dialog('removebutton', 'Cancelar');
            $('#noClavDiarDiv').dialog('addbutton', 'Aceptar', function(){$(this).dialog("close");window.location = '<c:url value="home.html"/>';});
        </script>
    </sec:authorize>
    
</div>